Skip to content

[typescript-fetch] Fix default response signature#444

Merged
mnahkies merged 1 commit intomnahkies:mn/439/fetch-default-response-narrowingfrom
paztis:mn/439/fetch-default-response-narrowing
May 2, 2026
Merged

[typescript-fetch] Fix default response signature#444
mnahkies merged 1 commit intomnahkies:mn/439/fetch-default-response-narrowingfrom
paztis:mn/439/fetch-default-response-narrowing

Conversation

@paztis
Copy link
Copy Markdown

@paztis paztis commented Mar 18, 2026

Fix for #439

Exclude already processed StatusCodes from default signature

@mnahkies mnahkies merged commit 13f6354 into mnahkies:mn/439/fetch-default-response-narrowing May 2, 2026
mnahkies added a commit that referenced this pull request May 2, 2026
relates #439, and includes changes from #444 as the actual fix

- adds failing test showing that type narrowing isn't working as
expected for fetch clients when a default response is present
- adjusts the types to exclude specific status codes from the default
response branch. The specification states that the default response is
only to be used for responses not otherwise declared:
> The documentation of responses other than the ones declared for
specific HTTP response codes. Use this field to cover undeclared
responses.

---------

Co-authored-by: jeromeh <jerome.henaff@amdocs.com>
@mnahkies
Copy link
Copy Markdown
Owner

mnahkies commented May 2, 2026

This is now in main via e22f3b0 - apologies I was sure to include you as a co-author, but Github doesn't appear to have recognized this completely, I'll mention you in the release notes.

I'm expecting to do a release in the next week or two - lifes been busy so it's been longer between releases than usual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants